<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta id="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta name="apple-themes-web-app-capable" content="yes">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection">
		<meta content="email=no" name="format-detection">
		<meta name="format-detection" content="telephone=no">
		<title>首页</title>
		<link rel="stylesheet" href="/css/main.css" type="text/css" media="all">
        <link rel="stylesheet" href="/layui/css/layui.css" media="all">
	</head>

	<body>

 	<!--页面加载 开始-->
     <div id="preloader">
     <div id="status">
      <p class="center-text"><span>拼命加载中···</span></p>
     </div>
    </div>
    <!--页面加载 结束-->
    <div id="content_div_b" class="p_bottom">
        <!--产品轮播-->
        <div class="top_pic">
            <div class="left_i"></div>
            <div class="right_i"></div>

            <div class="carousel-image" id="scroll_img">
                <div>
                    <a href="#"><img src="{{$img}}" style="width:280rem;height: 560rem" /></a>
                </div>
                <span class="carousel-num">
			            </span>
            </div>
        </div>
        <!--产品轮播结束-->
        <div class="cp_mian">
            @foreach($xq_row as $a)
                <h2>{{$a->name}}</h2>
                <p class="f_bt">{{$a->Subtitle}}参与{{$a->join}}人次，<中奖机></中奖机>率高出10倍</p>
                <ul>
                    <p>期号：{{$a->issueNumber}}<span>已完成 <em>{{$bfba}}%</em></span></p>
                    <li><em style="width:{{$a->progress}}%;"></em></li>
                    <p>总需人次 {{$a->need}} <span>剩余人次 <em> {{$number}}</em></span></p>
                </ul>
            @endforeach
        </div>
        <?php if(session('login_name')==null){?>
            <div class="cp_d01">
            马上登录1元购，收获惊喜！!<a href="denglu">立即登录</a>
            </div>
        <?php }?>
            <div class="cp_list">
              <ul>
                <li><em></em> 商品详情  <span>建议在WiFi下查看</span></li>
                <i></i>
              </ul>
              <ul>
                  <a href="dbgz"><li><em></em>夺宝规则  </li></a>
                <i></i>
              </ul>
               <ul>
                <a href="wqjx"><li><em></em> 往期揭晓 </li>
                <i></i></a>
              </ul>
               <ul>
                <a href="sycyjl"><li><em></em> 所有参与记录 </li>
                <i></i></a>
              </ul>
            </div>

		</div>

            <!--底部-->
             <div id="foot_div">
                 <div class="home_foot"><a href="ljdb" id="buy">立即夺宝</a></div>
             </div>
			<!--底部结束-->
		    <script type="text/javascript" src="/js/zepto.js"></script>
			<script type="text/javascript" src="/js/carousel-image.js"></script>
			<script>
				$('.carousel-image').CarouselImage({
					num: $('.carousel-image .carousel-num'),
					repeat: true
				});
			</script>
           <script type="text/javascript" src="/js/jquery.min.js"></script>
		   <script type="text/javascript" src="/js/common.js"></script>
           <script src="static/js/jquery.js"></script>
           <script src="assets/layui.js"></script>
	</body>

</html>

<script>
    $(function(){
        $('#buy').click(function () {
            $.get({
                url:"ljdb",
                data:'josn',
                success:function (data) {
                    layui.use('layer', function(){
                        var layer = layui.layer;
                        if(data.code=='1') {
                            layer.open({
                                title: '夺宝成功'
                                , skin: 'msg'
                                , content: data.name
                                , yes: function () {
                                    location.href = '';
                                }
                            });
                        }else if(data.code=='-1'){
                            layer.open({
                                title: '余额不足'
                                , skin: 'msg'
                                , content: data.name
                                , yes: function () {
                                    location.href = '';
                                }
                            });
                        }else {
                            layer.open({
                                title: '先充值吧'
                                , skin: 'msg'
                                , content: data.name
                                , yes: function () {
                                    location.href = '';
                                }
                            });
                        }
                    });
                }
            });
            return false;
        })
        });
</script>
